package labs.fourth;

public class StaticErrorReport {
	private static String _detailedErrorMessage = null;
	private static int _errorLineNumber;
	private static int _errorColumnNumber;
	private static boolean _isValidProgram;
	private static String _inputFileName;

	public static boolean isValid() {
		return _isValidProgram;
	}

	public static String getErrorMessage() {
		return _detailedErrorMessage;
	}

	public static int getErrorLineNumber() {
		return _errorLineNumber;
	}

	public static int getErrorColumnNumber() {
		return _errorColumnNumber;
	}

	public static String getFileName() {
		return _inputFileName;
	}

	/**
	 * @param detailedErrorMessage
	 *            the detailedErrorMessage to set
	 */
	public static void setErrorMessage(Token detailedErrorMessage) {
		setErrorMessage("");
	}

	public static void setErrorMessage(String detailedErrorMessage) {
		if (_detailedErrorMessage == null) {
			_detailedErrorMessage = detailedErrorMessage;
		}
	}

	/**
	 * @param errorLineNumber
	 *            the errorLineNumber to set
	 */
	public static void setErrorLineNumber(int errorLineNumber) {
		_errorLineNumber = errorLineNumber;
	}

	/**
	 * @param errorColumnNumber
	 *            the errorColumnNumber to set
	 */
	public static void setErrorColumnNumber(int errorColumnNumber) {
		_errorColumnNumber = errorColumnNumber;
	}

	/**
	 * @param isValidProgram
	 *            the isValidProgram to set
	 */
	public static void setValidProgram(boolean isValidProgram) {
		_isValidProgram = isValidProgram;
	}

	/**
	 * @param inputFileName
	 *            the inputFileName to set
	 */
	public static void setInputFileName(String inputFileName) {
		_inputFileName = inputFileName;
	}
}
